{layout name="main"/}
<script type="text/javascript" src="/static/js/jquery.citys.js"></script>
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>申请区域代理</h5>
                </div>
                <div class="ibox-content">
                    <form method="post" action="" class="form-horizontal m-t" id="applyAagent">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">会员编号 * </label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" value="{$user->user_uniid}"  readonly="readonly">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 当前申请者会员编号</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">申请时间 * </label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" value="{$nowtime}"  readonly="readonly">

                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-3 control-label">申请地区 * </label>
                            <div class="col-sm-5">
                              <div class="input-group m-b citys">
                                <select class="form-control" name="province" style="width:150px"></select>
                                <select class="form-control" name="city" style="width:150px"></select>
                                <select class="form-control" name="area" style="width:150px"></select>
                              </div>
                            </div>
                            <script type="text/javascript">
                                $('.citys').citys({
                                    required: false
                                });
                            </script>

                        </div>



                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注</label>
                            <div class="col-sm-5">

                                <textarea id="ccomment"  name="comments" class="form-control" style=" height: 100px;"></textarea>
                            </div>

                        </div>




                        <div class="hr-line-dashed"></div>

                           <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="button" onclick="add()">提交</button>
                            </div>
                        </div>





                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function add() {
        var postdata = $("#applyAagent").serialize();
        post({
            url: "{$thispageurl}",
            data: postdata,
            success: function(res) {
                swal({
                    title: 'success',
                    text: res.message,
                    type: "success"
                }, function() {
                    reload();
                });
            },
            error: function(error) {
                swal("错误", JSON.parse(error.responseText).message, "error");
            }
        });
    }
</script>
